<template>
    <div>
    <div class="zong">
        <div class="parent">
        <img class="bg" :src="detail.pic">
        <div class="blur">
            <div class="name">{{detail.title}}</div>
            <div class="top2">
                <span>{{detail.labels[1]}}</span> ·
                <span>{{detail.labels[0]}}</span>
            </div>
            <div class="top3">
                <span class="shuzi shuzi1">{{detail.evaluate}}</span>
                <span class="huise huise1">人喜欢</span>
                <span class="shuzi shuzi2">{{detail.evaluate}}</span>
                <span class="huise huise2">条评论</span>
            </div>
        </div>
        </div>
        <div class="box2">
        <span class="title">{{detail.title}}</span>
        <div>
            <span class="pf">评分</span>
            
            <span class="score">{{detail.rating}}</span>
        </div>
        
        
        
        <div class="box3">
            <span class="dy">导演</span><span class="dym">刘镇伟</span>
            <span class="yr">影人</span>
            <div class="Ed"><span>detail+"/"</span></div>
            <span class="type">类型</span><span class="jq">{{detail.labels[2]}}</span>
        </div> 
        </div>
        <div class="box4">
        <span class="jj">剧情简介</span>
        <span class="content1">movies.briefOne</span>
        <span class="content2">movies.briefTwo</span>
        </div>
        <div class="box5">
        <span class="member">影人</span>
        <img class="" src="">
        </div>
        <img class="pic1" :src="detail.pic">
    </div>

    <div>
        <img class="collect" @click="handleChange(detail.collected)" :src="detail.collected?collection:collectionanti" >
        <img class="share" :src="share"></div>

    </div>
</template>

<script>
import collection from '../../assets/images/icon/collection.png'
import collectionanti from '../../assets/images/icon/collection-anti.png'
import share from '../../assets/images/icon/share.png'
import share_anti from '../../assets/images/icon/share-anti.png'
import {getCollectMovie} from '../../model/MovieCollect'
    export default {
        data() {
            return {
                detail:[],
                collectionanti,collection,
                share,share_anti,
                collected:""
            }
        },
        async mounted() {
            var id = this.$route.params.id;
            var movieDetailUrl = `/api/movieDetail?id=${id}`;
            getCollectMovie(movieDetailUrl).then(res=>{
                // console.log(res.data.res[0])
                this.detail = res.data.res[0]
            })
        },
        methods: {
          handleChange(collected){
            this.detail.collected = !this.detail.collected
            this.collected = this.detail.collected
            console.log(collected)

          }
        },
    }
</script>

<style scoped>
.bg{
    height: 200px;
    filter: blur(5px);
  }
  .parent{
    position: relative;
  }
  .blur{
    position: absolute;
    top: 0;
    left: 0;
    height: 200px;
    width: 100%;
    z-index: 100;
    background-color: rgba(255,255,255,0.26);
  }
  .name{
    font-size: 18px;
    color: red;
    position: absolute;
    top: 20px;
    left: 15px;
  }
  .top2{
    font-size: 14px;
    color: red;
    position: absolute;
    top: 60px;
    left: 15px;
  }
  .top3{
    font-size: 14px;
    position: absolute;
    top: 150px;
    left: 15px;
  }
  .shuzi{
    color: crimson;
  }
  .huise{
    color: grey;
  }
  .huise1{
    margin-left: 10px;
  }
  .shuzi2{
    margin-left: 10px;
  }
  .huise2{
    margin-left: 10px;
  }
  .box2{
    position: relative;
    margin-bottom: 1px solid grey;
}
.title{
    font-weight: bold;
    margin-left: 15px;
    font-size: 12px;
  }
  .pf{
    position: absolute;
    margin-left: 15px;
    top: 60px;
  }
  .score{
    position: absolute;
    margin-left: 45px;
    top: 60px;
  }
  .box3{
    height: 170px;
    border-bottom: 1px solid rgba(185, 183, 183,0.45);
    position: relative;
  }
    
  .collect,.share{
    position: fixed;
    top: 63%;
    width: 80px;
    height: 80px;
}
.collect{
    right: 160px;
}
.share{
    right: 20px;
}
  .dy{
    position: absolute;
    top: 80px;
    margin-left: 15px;
  }
  .dym{
    position: absolute;
    top: 80px;
    margin-left: 45px;
  }
  .yr{
    position: absolute;
    top: 100px;
    margin-left: 15px;
  }
  .Ed{
    position: absolute;
    top: 100px;
    margin-left: 45px;
  }
  .type{
    position: absolute;
    top: 120px;
    margin-left: 15px;
  }
  .jq{
    position: absolute;
    top: 120px;
    margin-left: 45px;
  }
  .box4{
    height: 180px;
    border-bottom: 1px solid rgba(185, 183, 183,0.45);
    position: relative;
  }
  .jj{
    position: absolute;
    top: 25px;
    margin-left: 15px;
  }
  .content1{
    position: absolute;
    top: 50px;
    line-height: 18px;
    margin-left: 15px;
  }
  .content2{
    position: absolute;
    top: 110px;
    line-height: 18px;
    margin-left: 15px;
  }
  .box5{
    position: relative;
  }
  .member{
    position: absolute;
    top: 30px;
    margin-left: 15px;
  }
  .zong{
    position: relative;
    color: rgb(80, 79, 79);
    font-size: 11px;
  }
  .pic1{
    position: absolute;
    width: 50px;
    height: 100px;
    top: 150px;
    right: 15px;
}
</style>